package com.heyun.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.heyun.bean.HeyunContract;
import com.heyun.dao.ContractDao;
/**
 * @author CC
 * @Description 合同service层实现类
 * @Company 
 * @date 2017年12月14日
 */
import com.heyun.service.ContractService;
@Service
public class ContractServiceImpl implements ContractService {
	@Autowired
	private ContractDao contractDao;
	@Override
	public int insertContract(HeyunContract contract) {
		int insertResult = contractDao.insertContract(contract);
		return insertResult;
	}
	@Override
	public List<HeyunContract> listContract() {
		List<HeyunContract> contractList = contractDao.listContract();
		return contractList;
	}
	@Override
	public int deleteContract(Integer contractId) {
		int delResult = contractDao.deleteContract(contractId);
		System.out.println("删除记录："+delResult);		
		return delResult;
	}
	@Override
	public HeyunContract getContract(Integer contractId) {
		HeyunContract getResult = contractDao.getContract(contractId);
		return getResult;
	}
	@Override
	public int updateContract(HeyunContract contract) {
		int updateResult = contractDao.updateContract(contract);
		return updateResult;
	}
	@Override
	public int updateStates(Map<String, Object> map) {
		int updateResults = contractDao.updateStates(map);
		return updateResults;
	}
	@Override
	public int updateState(Map<String, Object> map) {
		int updateResult = contractDao.updateState(map);
		return updateResult;
	}
	@Override
	public int backContract(HeyunContract contract) {
		int updateResult = contractDao.backContract(contract);
		return updateResult;
	}
	@Override
	public int checkContract(HeyunContract contract) {
		int updateResult = contractDao.checkContract(contract);
		return updateResult;
	}
	@Override
	public List<HeyunContract> listContractByUwant(HeyunContract contract) {
		List<HeyunContract> contractList = contractDao.listContractByUwant(contract);
		return contractList;
	}
	@Override
	public List<HeyunContract> listContractType() {
		List<HeyunContract> contractList = contractDao.listContractType();
		return contractList;
	}
	
}
